# # CMake 最低版本号要求
cmake_minimum_required (VERSION 2.8)

set(CMAKE_CXX_STANDARD 11)

# 交叉编译 --- 设置编译器和目标平台
set(CMAKE_CXX_COMPILER "arm-linux-g++")
set(CMAKE_C_COMPILER "arm-linux-gcc")

include_directories(.)
include_directories(../Common)
include_directories(../Client)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../3rd/Sqlite3)
# include_directories(../OptInterface/RedisOpt)

aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/../../3rd/Sqlite3 DIR_SRCS)
# aux_source_directory(../OptInterface/RedisOpt DIR_SRCS)
aux_source_directory(../Common DIR_SRCS)
aux_source_directory(. DIR_SRCS)
add_executable(Log_Server ${DIR_SRCS})

# 链接库
# pthread
target_link_libraries(Log_Server pthread)
# target_link_libraries(Log_Server ${CMAKE_CURRENT_SOURCE_DIR}/../Client/libLogClientLib.a)
find_library(LOGCLIENTLIB NAMES LogClientLib PATHS ${CMAKE_CURRENT_SOURCE_DIR}/../Client/ NO_DEFAULT_PATH)
target_link_libraries(Log_Server ${LOGCLIENTLIB})

# dlopen
target_link_libraries(Log_Server dl)
# target_link_libraries(Log_Server sqlite3)
